package demo06.threadSafe;

public class Singleton {
	private static Singleton uniqueInstance;
	 
	// 其他有用的实例变量
 
	private Singleton() {}
 
	public static synchronized Singleton getInstance() {
		if (uniqueInstance == null) {
			uniqueInstance = new Singleton();
		}
		return uniqueInstance;
	}
 
	// 其他有用的方法
	public String getDescription() {
		return "我是线程安全的单利模式!";
	}

}
